package org.simplecrm.repository.customer;

import org.simplecrm.domain.customer.Customer;

import java.util.List;

/**
 * Defines an interface for obtaining and changing data of DB
 * from table "customer".
 */
public interface CustomerDAO {

    static final String CUST_ID_FIELD = "id";
    static final String CUST_NAME_FIELD = "name";
    static final String CUST_REGIONID_FIELD = "regionId";
    static final String CUST_INCOME_FIELD = "totalIncome";

    static final String GETTING_EVENTS_ERR = "Error while getting events of customer with id = ?";
    static final String NO_STAGE_ERR = "There is no Stage wtih such id: ?";

    /**
     * Use this for getting a list of all the customers.
     *
     * @return list of customers
     */
    List<Customer> getAllCustomers();

    /**
     * Is used for deleting customer with specified id.
     *
     * @param id customer's identifier
     */
    void deleteCustomer(int id);

    /**
     * Is used for getting customer with specified id.
     *
     * @param id customer's identifier
     * @return
     */
    Customer getCustomerById(int id);

    /**
     * Is used for creating new customer.
     *
     * @param newCustomer customer's object
     */
    void addNewCustomer(Customer newCustomer);

    /**
     * Is used for making changes in existing customer.
     *
     * @param changedCustomer customer's object
     */
    void updateCustomer(Customer changedCustomer);
}